import { BaseService } from '@/base/base.service'
import { Injectable } from '@nestjs/common'
import { Contracts } from '@prisma/client'
import { ContractDto } from './dto/contract.dto'
import { PrismaBaseService } from '@/prisma-base/prisma-base.service'

@Injectable()
export class ContractsService extends BaseService<Contracts, ContractDto> {
  constructor(private readonly prismaBase: PrismaBaseService) {
    super('Contracts')
  }

  async changeStatus(id: string, status: boolean) {
    await this.prismaBase.contracts.update({
      where: { id },
      data: { status },
    })
    return '修改成功'
  }
}
